package tr.helper.controller.login;

import cn.hutool.core.io.FileUtil;
import java.net.InetAddress;
import java.net.NetworkInterface;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import tr.helper.CommonUtil;
import tr.helper.repository.DataInitialization;

public class LoginMain extends Application {

    public static Stage stage;

    @Override
    public void start(Stage primaryStage) throws Exception {
        final DataInitialization initialization = new DataInitialization();
        try {
            initialization.initSchema(false);
        } catch (Exception e) {
            e.printStackTrace();
        }
        stage = primaryStage;
        stage.setTitle("辅助-登录");
        stage.setScene(new Scene(FXMLLoader.load(LoginMain.class.getResource("LoginForm.fxml"))));
        stage.show();
    }

    @Override
    public void stop() throws Exception {
        FileUtil.del(CommonUtil.getHomeImagePath());
        CommonUtil.log("exist-->");
    }

    public static void main(String[] args) {
        launch(args);
    }

}
